package com.edu.juc.lock.lockUpdate;

public class LockClearUpTest {
    static final Object object = new Object();

    public void m1() {
        Object o = new Object();
        // 锁消除问题，JIT编译器会无视它
        synchronized (o) {
            System.out.println("------");
        }
    }

    public static void main(String[] args) {
        LockClearUpTest lockClearUp = new LockClearUpTest();
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                lockClearUp.m1();
            }, String.valueOf(i)).start();
        }
    }
}
